package com.shj.em.aa.mapper;

import com.shj.em.aa.entity.Resource;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 资源 Mapper 接口
 * </p>
 *
 * @author Shen Huang Jian
 * @since 2018-06-21
 */
@Mapper
public interface ResourceMapper extends BaseMapper<Resource> {

    List<Resource> findResByUserLoginId(String userId);

    List<Resource> findResByUserId(Long userId);


    /**
     * 需要有 uid 的 key，没有时，表示获得所有
     * @param params
     * @return
     */
    List<Resource> getMenuResourcesByUserId(Map<String, String> params);

    List<Resource> findUnassignedResToRole(Long roleId);

    List<Resource> findAssignedResToRole(Long roleId);
}
